#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n, L = -1, x = 0, y = 0;
    string s;
    cin >> n >> s;
    for (int i = 0; i < n; i += 2) {
      if (s[i] != s[i + 1])
        x += 1;  // 需要进行一次修改
      else {
        if (L != s[i]) y += 1;  // 段数+1
        L = s[i];
      }
    }
    cout << x << ' ' << max(y, 1) << '\n';
  }
}
